package com.turing.post.report.util;

import java.io.Serializable;
import java.math.BigInteger;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.IdClass;
import javax.persistence.Table;

import com.turing.post.util.PCPSUtil;

/**
 * 联机转账对帐控制类
 * @author ZXL
 *
 */
@SuppressWarnings("serial")
@Entity
@Table(name = "ONLINETRANSFERCHKACCCTL")
@IdClass(OnlineTransferChkAccCtl.class)
public class OnlineTransferChkAccCtl implements Serializable{
	/**
	 * 银行管理ID
	 */
	private BigInteger bankManageId;
	/**
	 * 对帐日期
	 */
	private Date checkDate;
	/**
	 * 发卡商号
	 */
	private String issueCompanyNo;
	/**
	 * 对帐结果
	 */
	private String checkResult;
	/**
	 * 对总帐文件ID
	 */
	private BigInteger checkFileId;
	/**
	 * 对明细帐文件ID
	 */
	private BigInteger checkDetailFileId;
	/**
	 * 借方笔数
	 */
	private Integer debitCount;
	/**
	 * 借方金额
	 */
	private BigInteger debitAmt;
	/**
	 * 贷方笔数
	 */
	private Integer creditCount;
	/**
	 * 贷方金额
	 */
	private BigInteger creditAmt;
	
	/**
	 * 完全成功
	 */
	public static final String ONLINEACC_SUCCESS = "0";
	/**
	 * 尚未核对
	 */
	public static final String ONLINEACC_NOTACC = "1";
	/**
	 * 已自动调整一致
	 */
	public static final String ONLINEACC_AUTOMATICALIGNMENT  = "2";
	/**
	 * 需人工干预
	 */
	public static final String ONLINEACC_HUMANINTERVENTION = "3";
	/**
	 * 未发对帐请求
	 */
	public static final String ONLINEACC_NOTREQUESTACC = "9";
	
	@Id
	@Column(name = "BANKMANAGEID")
	public BigInteger getBankManageId() {
		return bankManageId;
	}
	public void setBankManageId(BigInteger bankManageId) {
		this.bankManageId = bankManageId;
	}
	@Id
	@Column(name = "CHECKDATE")
	public Date getCheckDate() {
		return checkDate;
	}
	public void setCheckDate(Date checkDate) {
		this.checkDate = checkDate;
	}
	@Column(name = "CHECKRESULT")
	public String getCheckResult() {
		return checkResult;
	}
	public void setCheckResult(String checkResult) {
		this.checkResult = checkResult;
	}
	@Column(name = "CHECKFILEID")
	public BigInteger getCheckFileId() {
		return checkFileId;
	}
	public void setCheckFileId(BigInteger checkFileId) {
		this.checkFileId = checkFileId;
	}
	@Column(name = "DEBITCOUNT")
	public Integer getDebitCount() {
		return debitCount;
	}
	public void setDebitCount(Integer debitCount) {
		this.debitCount = debitCount;
	}
	@Column(name = "DEBITAMT")
	public BigInteger getDebitAmt() {
		return debitAmt;
	}
	public void setDebitAmt(BigInteger debitAmt) {
		this.debitAmt = debitAmt;
	}
	@Column(name = "CREDITCOUNT")
	public Integer getCreditCount() {
		return creditCount;
	}
	public void setCreditCount(Integer creditCount) {
		this.creditCount = creditCount;
	}
	@Column(name = "CREDITAMT")
	public BigInteger getCreditAmt() {
		return creditAmt;
	}
	public void setCreditAmt(BigInteger creditAmt) {
		this.creditAmt = creditAmt;
	}
	@Column(name = "ISSUECOMPANYNO")
	public String getIssueCompanyNo() {
		return issueCompanyNo;
	}
	public void setIssueCompanyNo(String issueCompanyNo) {
		this.issueCompanyNo = issueCompanyNo;
	}
	@Column(name = "CHECKDETAILFILEID")
	public BigInteger getCheckDetailFileId() {
		return checkDetailFileId;
	}
	public void setCheckDetailFileId(BigInteger checkDetailFileId) {
		this.checkDetailFileId = checkDetailFileId;
	}
	@Override
	public int hashCode() {
		return PCPSUtil.getObjectListHashCode(new Object[] { getBankManageId(),
				getCheckDate()});
	}
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (!(obj instanceof OnlineTransferChkAccCtl))
			return false;
		OnlineTransferChkAccCtl other = (OnlineTransferChkAccCtl) obj;
		if (!PCPSUtil
				.compareObject(this.getBankManageId(), other.getBankManageId()))
			return false;
		
		return PCPSUtil
				.compareObject(this.getCheckDate(), other.getCheckDate());
	}
	
	
}
